package com.lsh.dao;

import com.lsh.entity.QueryPageBean;
import com.lsh.pojo.CheckItem;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface CheckItemDao {
    @Select("select * from t_checkitem")
    List<CheckItem> findAll();

    void add(CheckItem checkItem);

    List<CheckItem> findPage(QueryPageBean queryPageBean);
    @Select("select count(0) from t_checkgroup_checkitem where checkitem_id = #{id}")
    int findCountByCheckItemId(Integer id);
    @Delete("delete from t_checkitem where id = #{id}")
    void deleteById(Integer id);
    @Select("select * from t_checkitem where id = #{id}")
    CheckItem findById(Integer id);
    @Update("update t_checkitem set code=#{code},name=#{name}," +
            "sex=#{sex},age=#{age},price=#{price},type=#{type}," +
            "remark=#{remark},attention=#{attention}where id=#{id}")
    void update(CheckItem checkItem);
}
